Closed
Conversation
Two unrelated issues blocked HTTP::Client::Parallel: 1. POSIX.pm did not export the termios constants nor the _SC_* sysconf() name constants used by POE::Wheel::Run (loaded transitively from HTTP::Client::Parallel via POE). The Java side already implemented _const_ECHO, _const_TCSANOW, etc., and POSIX.pm wired them into POSIX::ECHO, POSIX::TCSANOW, ... but they were missing from @EXPORT_OK so `use POSIX qw(ECHO ...)` died with "ECHO is not exported by the POSIX module". Add the termios and _SC_* names to @EXPORT_OK and provide a small sysconf() stub that returns sensible defaults (e.g. _SC_OPEN_MAX => 1024). 2. The 1-argument form `open FILEHANDLE` (used by Module::Install::DSL, which LWP::Online ships) crashed with "Modification of a read-only value" when the filehandle was given as a numeric literal such as `open 0`. The runtime tried to call set() on the readonly arg and was also picking the filename from $_ instead of from the global scalar of the same name as the filehandle. Rewrite the 1-arg open path to derive the filehandle name from the value (covering glob refs, bareword strings, and numeric literals like 0), look up the filename in $main::<name>, and only assign back to args[0] when it is a writable scalar. With both fixes, `jcpan -t HTTP::Client::Parallel` and its LWP::Online dependency build and pass their unit tests. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Owner
Author
|
Superseded by #593, which contains both this fix and the op/state.t interpreter fix in a single PR. |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two unrelated issues that blocked
jcpan -t HTTP::Client::Parallel.1. POSIX missing exports
POE::Wheel::Run(loaded transitively fromHTTP::Client::Parallelvia POE) does:The Java side already implemented
_const_ECHO,_const_TCSANOW, ... andPOSIX.pmwired them intoPOSIX::ECHO,POSIX::TCSANOW, ..., but those names were missing from@EXPORT_OK, so the import died with"ECHO" is not exported by the POSIX moduleand the rest of POE failed to compile._SC_*sysconf-name family to@EXPORT_OK.sysconf()stub that returns sensible defaults (e.g._SC_OPEN_MAX => 1024).2.
open 0(one-argument open of a numeric literal)LWP::OnlineshipsModule::Install::DSL, whoseimportdoesopen 0 or die ...; $dsl = join "", <0>;. PerlOnJava crashed with:The 1-arg
openpath inIOOperator.javaalways calledfileHandle.set(...)even whenargs[0]was a readonly literal scalar, and pulled the filename from$_instead of from the global scalar of the same name as the filehandle.Rewrote the 1-arg
openblock to:$main::<name>(soopen 0reads from$0).args[0]when it is a writable scalar (skip readonly literals).Test plan
make(full unit-test suite) passes.jcpan -t LWP::Online→ PASS (8/8 tests).jcpan -t HTTP::Client::Parallel→ PASS (live-internet test correctly skipped).Generated with Devin